package com.yt.server.main;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * Boot-straps
 */
public class Bootstrap {

	/**
	 * 获取ROOT配置文件
	 * 
	 * @param root
	 * @return
	 */
	@SuppressWarnings("unused")
	private static String getConfigurationRoot(String root) {
		return null;
	}

	/**
	 * 获取ROOT
	 * 
	 * @throws IOException
	 * @return
	 */
	@SuppressWarnings("unused")
	private static String getRoot() throws IOException {
		return null;
	}

	public static void main(String[] args) throws InstantiationException,
			IllegalAccessException, ClassNotFoundException, SecurityException,
			NoSuchMethodException, IllegalArgumentException,
			InvocationTargetException {
		String os = System.getProperty("os.name").toLowerCase();
		System.out.println("服务器系统：" + os);
		ClassLoader loader = Thread.currentThread().getContextClassLoader();
		Thread.currentThread().setContextClassLoader(loader);
		Object boot = Class
				.forName("com.yt.server.main.Launcher", true, loader)
				.newInstance();
		Method m1 = boot.getClass().getMethod("launch", (Class[]) null);
		m1.invoke(boot, (Object[]) null);
		Thread.currentThread().setContextClassLoader(loader);
		System.out.println("服务器启动完毕,等待连接中.");
	}
}